package org.nf.Impl;

import org.nf.SqlRunner;
import org.nf.User;
import org.nf.UserDao;
import org.nf.util.DbUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhu
 * @date 2024-04-25
 */
public class UserDaoImpl implements UserDao {
    SqlRunner sqlRunner = new SqlRunner(DbUtil.getConnection());
    @Override
    public List<User> findAllUsers() {
        String sql = "select id,username,password,level,image,phone,email,registerTime,status from user";
        List<User> userList = new ArrayList<User>();
        userList = sqlRunner.queryList(User.class, sql);
        return userList;
    }
}
